function myAjax(url,type,data,dataType) {
    console.log(data);
    let result = null;
    $.ajax({
        url: url,
        type: type,
        async: false,//必须写该句，才能同步处理
        data: data,
        dataType: dataType,
        xhrFields: {
            withCredentials: true //默认情况下，标准的跨域请求是不会发送cookie的
        },
        success: function (data) {
            console.log(data);
            result = data;
        },
        error: function () {
            console.log();
            result = 404;
        }
    });
    return result;
}
function getData() {
    let data = myAjax("/data/getDataList","get",{},"json");
    console.log(data);
    let gender=data.gender;
    let degree=data.degree;
    let status=data.status;
    let team = data.team;
    let enable = data.enabled;
    let role = data.role;
    sessionStorage.setItem("gender",JSON.stringify(gender));
    sessionStorage.setItem("degree",JSON.stringify(degree));
    sessionStorage.setItem("status",JSON.stringify(status));
    sessionStorage.setItem("team",JSON.stringify(team));
    sessionStorage.setItem("enable",JSON.stringify(enable));
    sessionStorage.setItem("role",JSON.stringify(role));
}
function selectAll() {
    $("input[type=checkbox]").prop("checked", true);
}
function deselectAll() {
    $("input[type=checkbox]").prop("checked", false);
}
function selectInvert() {
    $("input[type=checkbox]").each(function (key, value) {
        if ($(this).val()!="on") {
            if ($(this).prop("checked") == true)
                $(this).prop("checked",false);
            else if ($(this).prop("checked") == false)
                $(this).prop("checked",true);
        }
    });
}